package com.study.business;


import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

import java.util.concurrent.ScheduledThreadPoolExecutor;


/**
 * @author zhang
 * @version 1.0
 * @Date 2019年3月19日
 */

@Slf4j
@EnableTransactionManagement
@MapperScan(basePackages = "com.study")
@SpringBootApplication
public class WebApplication {


    public static void main(String[] args) {
        log.info("web user start!");
        SpringApplication.run(WebApplication.class, args);
    }

    @Bean
    public RestTemplate setRestTemplate() {
        return new RestTemplate();
    }


    @Bean(destroyMethod = "shutdown")
    public ScheduledThreadPoolExecutor set() {
        ScheduledThreadPoolExecutor pool = new ScheduledThreadPoolExecutor(5);
        return pool;
    }
}
